<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:dt="http://java.sun.com/jsf/composite/components"
                xmlns:p="http://primefaces.org/ui"
                template="./template2.xhtml">
    
    <ui:define name="mainContent">
        <h2>Create League</h2>
        <div class="inset">
            <h:form>
                <h:outputLabel value="#{leagueBean.name}" id="leagueName" style="color: #ffffff"/><br/>
                <h:outputLabel value="League name: " />
                <p:inputText value="#{leagueBean.name}"/>
                <p:commandButton value="Submit" update="leagueName" />
            </h:form>
            <h4 class="fancy">Invites</h4>
            <h:form id="addTeams">
                <p:inputText value="#{leagueBean.newTeam}" id="inviteInput" />
                <p:commandButton value="Submit" actionListener="#{leagueBean.addNewTeam}" update="invites,inviteInput"/><br/>
                <h:panelGrid id="invites">
                    <ui:repeat value="#{leagueBean.invitedTeams}" var="team">
                        <h:outputLabel value="#{team}" /><br/>
                    </ui:repeat>
                </h:panelGrid>
                <h:outputLabel value="#{leagueBean.inviteString}" id="leagueError" style="color: #cc0033"/><br/>
                <p:commandButton value="Start League" action="#{leagueBean.startLeague}" update="leagueError" />
                <p:commandButton value="Clear" actionListener="#{leagueBean.clear}" update="invites" />
            </h:form>
            
                
                
                
        </div>
    </ui:define>
    
</ui:composition>
